class A:
    def __init__(self):
        self.num1 = 100
        self.__num2 = 200

    def demo(self):
        print(self.__num2)

class B(A):
    def __init__(self):
        self.num3 = 300    #如果继承父类，再自己增加init，会覆盖父类
        #此时要使用super().__init__()
        super().__init__()
    def demo1(self):
        print(self.num1)

a = A()
a.demo()

print('-'*50)
b = B()
print(b.num1)
b.demo1()